package com.dunqi.gpm.cangxi.WeekReport.WeekPlan

import com.chad.library.adapter.base.BaseViewHolder

import com.dunqi.gpm.cangxi.R
import com.dunqi.gpm.cangxi.WeekReport.Model.WeekPlan
import com.dunqi.gpm.cangxi.WeekReport.OnListFragmentInteractionListener
import com.dunqi.gpm.cangxi.common.base.RecyclerAdapter

class WeekPlanRecyclerViewAdapter(mValues: List<WeekPlan>, private val mListener: OnListFragmentInteractionListener?) : RecyclerAdapter<WeekPlan>(R.layout.fragment_itemweekplan, mValues) {
    override fun convert(helper: BaseViewHolder?, item: WeekPlan?) {
        if (item === null) {
            return
        }
        helper?.setText(R.id.project_name, item.projectName)//项目名称
        helper?.setText(R.id.project_plan_week, "${item.projectPlanWeekly.weeks}")//计划周次
        helper?.setText(R.id.project_plan_content, "${item.projectPlanWeekly.context}")//计划内容
//        helper?.setText(R.id.project_duty_units, "")//责任单位
//        helper?.setText(R.id.project_superversion_units, item.supervisionUnitName)//监理单位
//        helper?.setText(R.id.project_implement_units, item.constructionUnitName)//施工单位
//        helper?.setText(R.id.project_plan_writer, "")//填报人
        helper?.setText(R.id.project_plan_write_time, "${item.projectPlanWeekly.createTime}")//填报时间

        helper?.setText(R.id.project_duty_units, "")//责任单位
        helper?.setText(R.id.project_superversion_units, "")//监理单位
        helper?.setText(R.id.project_implement_units, "")//施工单位
        helper?.setText(R.id.project_plan_writer, "")//填报人


        helper?.itemView?.setOnClickListener { mListener?.onListFragmentInteraction(item, myFlag) }
    }

    val myFlag = 2
}